import Foundation
import OSLog

enum LogLevel: String {
    case debug = "DEBUG"
    case info = "INFO"
    case warning = "WARN"
    case error = "ERROR"
}

protocol LoggerType {
    func log(_ level: LogLevel, _ message: String)
}

struct DefaultLogger: LoggerType {
    private let logger = Logger(subsystem: "com.bitdoor.Travel", category: "app")

    func log(_ level: LogLevel, _ message: String) {
        switch level {
        case .debug: logger.debug("\(message, privacy: .public)")
        case .info: logger.info("\(message, privacy: .public)")
        case .warning: logger.warning("\(message, privacy: .public)")
        case .error: logger.error("\(message, privacy: .public)")
        }
    }
}


